import axios from '@/plugins/axios'
export default {
  // mon/monTagSummary/getTagCountSummary 获取标签总数汇总
  getTagCountSummary(params) {
    return axios({
      url: axios.setUrl('mon/monTagSummary/getTagCountSummary'),
      method: 'get',
      params: axios.setParams(params)
    })
  },
  // getTagManageSummary 获取标签管理汇总
  getTagManageSummary(params) {
    return axios({
      url: axios.setUrl('mon/monTagSummary/getTagManageSummary'),
      method: 'get',
      params: axios.setParams(params)
    })
  },
  // getTagRequireSummary 获取标签需求汇总
  getTagRequireSummary(params) {
    return axios({
      url: axios.setUrl('mon/monTagSummary/getTagRequireSummary'),
      method: 'get',
      params: axios.setParams(params)
    })
  },
  // getTagSourceSummary 获取标签接入汇总
  getTagSourceSummary(params) {
    return axios({
      url: axios.setUrl('mon/monTagSummary/getTagSourceSummary'),
      method: 'get',
      params: axios.setParams(params)
    })
  },
  // getTagQualitySummary 获取标签质量汇总
  getTagQualitySummary(params) {
    return axios({
      url: axios.setUrl('mon/monTagSummary/getTagQualitySummary'),
      method: 'get',
      params: axios.setParams(params)
    })
  },
  // getTagUsageSummary 获取标签使用监控
  getTagUsageSummary(params) {
    return axios({
      url: axios.setUrl('mon/monTagSummary/getTagUsageSummary'),
      method: 'get',
      params: axios.setParams(params)
    })
  },
  // getTagUserSummary 获取标签用户汇总
  getTagUserSummary(params) {
    return axios({
      url: axios.setUrl('mon/monTagSummary/getTagUserSummary'),
      method: 'get',
      params: axios.setParams(params)
    })
  },
  /* 指标列 */
  // monTagInfo/pageList 通过分类体系ID获取分类列表
  indicatorList(params) {
    return axios({
      url: axios.setUrl('mon/monTagInfo/pageList'),
      method: 'get',
      params: axios.setParams(params)
    })
  },
  /* 标签监控指标代码列接口
Mon Tag Alarm Config Controller
 */
  // monTagAlarmConfig/config/threshold 根据标签ID 和 代码值更新告警阈值
  updateThreshold(params) {
    return axios({
      url: axios.setUrl('mon/monTagAlarmConfig/config/threshold'),
      method: 'post',
      data: axios.setParams(params)
    })
  },
  // monTagAlarmConfig/page 通过id获取标签监控指标代码列详情
  codeDetailList(params) {
    return axios({
      url: axios.setUrl('mon/monTagAlarmConfig/page'),
      method: 'get',
      params: axios.setParams(params)
    })
  },
  // monTagAlarmConfig/threshold 获取全局告警阈值
  getThresGlobalConfig(params) {
    return axios({
      url: axios.setUrl('mon/monTagAlarmConfig/threshold'),
      method: 'get',
      params: axios.setParams(params)
    })
  },
  // monTagAlarmConfig/threshold/{alarmThreshold} 更新全局告警阈值
  updateGlobalThreshold(params) {
    return axios({
      url: axios.setUrl(`mon/monTagAlarmConfig/threshold/${params.alarmThreshold}`),
      method: 'post',
      data: axios.setParams(params)
    })
  },
  /* 标签监控明细接口
Mon Tag Detail Controller */

  // monTagDetail/detail/history 根据分行号，标签ID，代码值查找7天历史数据
  historyData(params) {
    return axios({
      url: axios.setUrl('mon/monTagDetail/detail/history'),
      method: 'get',
      params: axios.setParams(params)
    })
  },
  // monTagDetail/detail/page 根据分行号和标签ID获取监控标签列表
  codeList(params) {
    return axios({
      url: axios.setUrl('mon/monTagDetail/detail/page'),
      method: 'get',
      params: axios.setParams(params)
    })
  },
  // monTagDetail/info/page 根据分行号获取监控标签列表
  getBranchTagList(params) {
    return axios({
      url: axios.setUrl('mon/monTagDetail/info/page'),
      method: 'get',
      params: axios.setParams(params)
    })
  },
  // monTagDetail/status 根据分行号，标签ID，代码值更新代码值状态
  updateCodeStatus(params) {
    return axios({
      url: axios.setUrl(`mon/monTagDetail/status`),
      method: 'post',
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
      },
      data: axios.setData(params, true, '1')
    })
  }
}
